<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="application/msword; charset=utf-8"/>
    <title>toWord</title>
    <style type="text/css">
        /*table start*/
        table{
            width: 100%;
            font-size: 14px;
            border-collapse: collapse;
            border-spacing: 0;
        }

        table.default-table tbody tr {
            height: 20px;
            line-height: 20px;
        }

        table.default-table tbody tr.odd {
            background-color: #fff;
        }

        table.default-table tbody tr.even {
            background-color: #F5F5F5;
        }

        table.default-table tbody tr:hover {
            background-color: #eee;
        }

        table.default-table tbody tr th, table.default-table tbody tr td {
            padding: 3px 5px;
            text-align: left;
            /* border: 1px solid #ddd; */
            border: solid #333;
            border-width: 0px 1px 1px 0px;
        }

        table.default-table tbody tr th {
            font-weight: bold;
            text-align: center;
        }

        table.default-table tbody tr td.tac {
            text-align: center;
        }

        table.default-table tbody tr td a:hover {
            color: #0080c0;
        }

        .textarea-style {
            font-size: 14px;
            font-weight: bold;
            color: #000;
            background-color: #d7d7d7;
            width: 100%;
            border: solid #333;
            border-width: 1px 0px 0px 1px;
        }

        .bg {
            font-size: 14px;
            font-weight: bold;
            color: #000;
            background-color: #d7d7d7;
        }

        tr {
            height: 32px;
            font-size: 12px;
        }

        td {
            padding-left: 10px;
            border-width: 1px;
            border-style: solid;
            border-color: black;
            height: 32px;
            overflow: hidden;
            word-break: break-all;
            word-wrap: break-word;
            font-size: 14px;
        }

        .bg td {
            font-size: 14px;
        }

        tr td {
            font-size: 14px;
        }

        .specialHeight {
            height: 40px;
        }

        .first_title {
            height: 60px;
            line-height: 60px;
            margin: 0;
            font-weight: bold;
            font-size: 21px;
        }

        .second_title {
            height: 40px;
            line-height: 40px;
            margin: 0;
            font-size: 18px;
        }

        .third_title {
            height: 40px;
            line-height: 40px;
            margin: 0;
            font-size: 16px;
        }

        .doc_title {
            font-size: 42px;
            text-align: center;
        }

        .download_btn {
            float: right;
        }

        .mystyle {
            border-top: none;
            border-left: none;
            border-bottom: solid #CCCCCC 1.0pt;
            border-right: solid #CCCCCC 1.0pt;
            padding: 4.5pt 9.0pt 4.5pt 9.0pt
        }

        body {
            font-family: 思源黑体 Normal;
        }
    </style>
</head>
<body>
<div style="width:1000px; margin: 0 auto">
    <div>
        <p class="doc_title" th:text="${datasource.datasourceName +' 数据库设计文档'}"></p>
        <a class="download_btn" th:if="${download == 1}"
           th:href="${downloadUrl}">下载文档</a>
        <br>
    </div>
    <div th:each="module,moduleStat:${moduleList}" style="margin-bottom:20px;">
        <!--这个是类的说明-->
        <h3 class="first_title" th:text="${(moduleStat.index+1)+'.'+module.moduleName+'('+module.tableList.size()+')'}"></h3>
        <div th:each="table,tableStat:${module.tableList}" style="margin-bottom:20px;">
            <h5 class="second_title" th:text="${(moduleStat.index+1)+'.'+(tableStat.index+1)+'.'+table.tableComment+'('+table.tableName+')'}"></h5>
            <table border="1" cellspacing="0" cellpadding="0" width="100%">
                <tr class="bg">
                    <td width="5%">序号</td>
                    <td width="20%">字段名称</td>
                    <td width="18%">字段类型</td>
                    <td width="8%">是否为空</td>
                    <td width="8%">是否主键</td>
                    <td width="8%">默认值</td>
                    <td width="23%">备注/说明</td>
                </tr>
                <th:block>
                    <tr th:each="column,cloumnStat:${table.columnList}">
                        <td align="left" th:text="${cloumnStat.index+1}"></td>
                        <td th:text="${column.columnName}"></td>
                        <td th:text="${column.columnType}"></td>
                        <td th:text="${column.isNullable}"></td>
                        <td th:text="${column.columnKey}"></td>
                        <td th:text="${column.columnDefault}"></td>
                        <td th:text="${column.columnComment}"></td>
                    </tr>

                </th:block>
            </table>
        </div>
    </div>
</div>

</body>
</html>
